package com.pay.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pay.entity.MerchantSecretKeyDO;
import com.pay.mapper.MerchantSecretKeyMapper;
import com.pay.service.MerchantSecretKeyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhouyihe
 * @since 2024-04-23
 */
@Service
public class MerchantSecretKeyServiceImpl implements MerchantSecretKeyService {
    @Autowired
    private MerchantSecretKeyMapper merchantSecretKeyMapper;
    
    /**
     * 根据appId和appKey查询数据库
     * @param appId
     * @param appKey
     * @return
     */
    @Override
    public MerchantSecretKeyDO getByAppIdKeyMerchantSecret(String appId, String appKey) {
        QueryWrapper<MerchantSecretKeyDO> merchantSecretKeyDOQueryWrapper = new QueryWrapper<>();
        merchantSecretKeyDOQueryWrapper.eq("app_id", appId);
        merchantSecretKeyDOQueryWrapper.eq("app_key", appKey);
        return merchantSecretKeyMapper.selectOne(merchantSecretKeyDOQueryWrapper);
    }
}
